home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume4 / clock < prev    next >
Encoding:
Internet Message Format  |  1989-02-03  |  24.9 KB

  1. Path: xanth!mcnc!rutgers!tut.cis.ohio-state.edu!cwjcc!hal!ncoast!allbery
  2. From: george@rebel.UUCP (George M. Sipe)
  3. Newsgroups: comp.sources.misc
  4. Subject: v04i121: large digital clock
  5. Message-ID: <48342@rebel.UUCP>
  6. Date: 11 Oct 88 02:22:59 GMT
  7. Sender: allbery@ncoast.UUCP
  8. Reply-To: george@rebel.UUCP (George M. Sipe)
  9. Organization: Tolerant Systems, Atlanta GA
  10. Lines: 702
  11. Approved: allbery@ncoast.UUCP
  12.  
  13. Posting-number: Volume 4, Issue 121
  14. Submitted-by: "George M. Sipe" <george@rebel.UUCP>
  15. Archive-name: clock
  16.  
  17. [The second of three manglings of net.classics...  ++bsa]
  18.  
  19. #! /bin/sh
  20. # This is a shell archive, meaning:
  21. # 1. Remove everything above the #! /bin/sh line.
  22. # 2. Save the resulting text in a file.
  23. # 3. Execute the file with /bin/sh (not csh) to create:
  24. #    README
  25. #    Makefile
  26. #    clock.man
  27. #    clock.c
  28. #    digits.c
  29. # This archive created: Tue Aug  9 01:02:42 1988
  30. export PATH; PATH=/bin:/usr/bin:$PATH
  31. if test -f 'README'
  32. then
  33.     echo shar: "will not over-write existing file 'README'"
  34. else
  35. sed 's/^X//' << \SHAR_EOF > 'README'
  36. XClock displays a large 4-digit, 12-hour clock on the user's screen.  A
  37. Xline containing the hostname is displayed above the time and a line
  38. Xcontaining the full date and time is displayed after it.
  39. X
  40. XUnlike another recent clock program posting, this program is
  41. Xstand-alone and does not depend on the presence or operation of any
  42. Xother program (e.g. System V banner).
  43. X
  44. XThe display is updated once every minute (low SBB overhead) by
  45. Xdefault.  If refresh_rate is specified, then the display is updated
  46. Xevery refresh_rate seconds.  Clock will automatically synchronize
  47. Xitself to even minute, or fraction of minute boundaries.  The first
  48. Xrefresh after the initial display will therefore probably be less than
  49. Xthe default or specified refresh rate.  After that however, the updates
  50. Xwill be very regular.
  51. X
  52. XIf clock is run under GNU Emacs terminal-emulator function, it will
  53. Xautomatically use slightly fewer lines in order to fit the display
  54. Xwindow on a normal 24 line terminal.
  55. X
  56. XThe interrupt character ends the program and clears the screen.
  57. X
  58. X
  59. X     Copyright (c) 1988 by George M. Sipe.  All rights reserved.
  60. X
  61. XThis software may only be redistributed without fee and without any
  62. Xother form of monetary gain (including sold, rented, leased, or
  63. Xtraded), unless the express written permission of the copyright holder
  64. Xis obtained in advance.
  65. X
  66. XThis copyright notice must be reproduced in its entirety on all copies
  67. Xof this software.  Further, acknowledgment of the authorship of this
  68. Xsoftware must not be removed from its current or derived
  69. Xdocumentation.
  70. X
  71. XNo expressed or implied warranty is made for this software.  No party
  72. Xconnected with this software assumes any liability or responsibility
  73. Xfor its use, the correctness of its operation, or its fitness for any
  74. Xpurpose.
  75. X
  76. XAny distributor of copies of this software shall grant the recipient
  77. Xpermission for further redistribution as permitted by this notice.
  78. X
  79. XPermission is hereby granted to copy, reproduce, redistribute and
  80. Xotherwise use this software as long as the conditions above are
  81. Xstrictly adhered to.
  82. X
  83. XNOTE:   This software was originally written by Jim Earenluindil
  84. X    Trethewey and modified by George M. Sipe (rebel!george) to the
  85. X    point where Jim would no longer recognize it.  No copyright
  86. X    notices were embodied in the original net distribution.
  87. SHAR_EOF
  88. fi
  89. if test -f 'Makefile'
  90. then
  91.     echo shar: "will not over-write existing file 'Makefile'"
  92. else
  93. sed 's/^X//' << \SHAR_EOF > 'Makefile'
  94. X# Makefile for:  clock - digital clock display
  95. X
  96. XDEFINES        = -DBSD
  97. XCFLAGS        = -O $(DEFINES)
  98. XLIBS        = -lcurses -ltermcap
  99. XROFF        = nroff
  100. XRFLAGS        = -man
  101. XLDFLAGS        = -s
  102. XDESTBIN        = ${HOME}
  103. XDESTMAN        = ${HOME}
  104. XDESTCAT        = ${HOME}
  105. XDESTOWN        = root
  106. XDESTGRP        = staff
  107. XSHELL        = /bin/sh
  108. XMAKEFILE    = Makefile
  109. XPROGRAM        = clock
  110. XMANPAGES    = clock.man
  111. XCATPAGES    = clock.cat
  112. XSRCS        = clock.c digits.c
  113. XOBJS        = clock.o digits.o
  114. X
  115. X.man.cat:
  116. X        $(ROFF) $(RFLAGS) $< > $@
  117. X
  118. X.SUFFIXES:    .man .cat
  119. X
  120. X# Compile and load the program and format its manual pages.
  121. Xall:        $(PROGRAM) $(CATPAGES)
  122. X
  123. X$(PROGRAM):    $(OBJS)
  124. X        $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
  125. X
  126. X# Run lint on source files, put results on standard output.
  127. Xlint:
  128. X        lint -u $(DEFINES) $(SRCS)
  129. X
  130. X# Create a tags file for use by a source code editor.
  131. Xtags:        $(SRCS)
  132. X        ctags $(SRCS)
  133. X
  134. X# Edit the makefile and regenerate the dependency information.
  135. Xdepend:
  136. X        mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DESTBIN=$(DESTBIN)
  137. X
  138. X# Print an index of functions on standard output.
  139. Xindex:
  140. X        ctags -wx $(SRCS)
  141. X
  142. X# Print source code files on standard output.
  143. Xprint:
  144. X        lpr -p $(SRCS) $(MANPAGES)
  145. X
  146. X# Compile and load the program, format manual pages, and move them
  147. X# to their destination directories.
  148. Xinstall:    $(PROGRAM) $(CATPAGES)
  149. X        cp $(PROGRAM) $(DESTBIN)
  150. X        chmod 755 $(DESTBIN)/$(PROGRAM)
  151. X        chown $(DESTOWN) $(DESTBIN)/$(PROGRAM)
  152. X        chgrp $(DESTGRP) $(DESTBIN)/$(PROGRAM)
  153. X        -for manpage in $(MANPAGES); do \
  154. X            basepage=`basename $$manpage .man`; \
  155. X            cp $$basepage.man $(DESTMAN)/$$basepage.l; \
  156. X            chmod 644 $(DESTMAN)/$$basepage.l; \
  157. X            chown $(DESTOWN) $(DESTMAN)/$$basepage.l; \
  158. X            chgrp $(DESTGRP) $(DESTMAN)/$$basepage.l; \
  159. X            cp $$basepage.cat $(DESTCAT)/$$basepage.l; \
  160. X            chmod 644 $(DESTCAT)/$$basepage.l; \
  161. X            chown $(DESTOWN) $(DESTCAT)/$$basepage.l; \
  162. X            chgrp $(DESTGRP) $(DESTCAT)/$$basepage.l; \
  163. X        done
  164. X
  165. X# Remove the program and its formatted manual pages from their
  166. X# destination directories.
  167. Xuninstall:
  168. X        rm -f $(DESTBIN)/$(PROGRAM)
  169. X        -for manpage in $(MANPAGES); do \
  170. X            basepage=`basename $$manpage .man`; \
  171. X            rm -f $(DESTMAN)/$$basepage.l; \
  172. X            rm -f $(DESTCAT)/$$basepage.l; \
  173. X        done
  174. X
  175. X# Remove all target and intermediate files.
  176. Xclean:
  177. X        -rm -f $(PROGRAM) $(CATPAGES) $(OBJS)
  178. X        -rm -f core a.out made *.o
  179. SHAR_EOF
  180. fi
  181. if test -f 'clock.man'
  182. then
  183.     echo shar: "will not over-write existing file 'clock.man'"
  184. else
  185. sed 's/^X//' << \SHAR_EOF > 'clock.man'
  186. X.TH CLOCK l "21 July 1988"
  187. X.SH NAME
  188. Xclock \- digital clock display
  189. X.SH SYNTAX
  190. X.B clock "[refresh_rate]"
  191. X.SH DESCRIPTION
  192. X.I Clock
  193. Xdisplays a large 4-digit, 12-hour clock on the user's screen.  A line
  194. Xcontaining the hostname is displayed above the time and a line
  195. Xcontaining the full date and time is displayed after it.
  196. X.PP
  197. XThe display is updated once every minute (low system overhead) by
  198. Xdefault.  If
  199. X.B refresh_rate
  200. Xis specified, then the display is updated every
  201. X.B refresh_rate
  202. Xseconds.
  203. X.I Clock
  204. Xwill automatically synchronize itself to even minute, or fraction of
  205. Xminute boundaries.  The first refresh after the initial display will
  206. Xtherefore probably be less than the default or specified refresh rate.
  207. XAfter that however, the updates will be very regular.
  208. X.PP
  209. XIf
  210. X.I clock
  211. Xis run under
  212. X.I "GNU Emacs"
  213. X.B "terminal-emulator"
  214. Xfunction, it will automatically use slightly fewer lines in order to
  215. Xfit the display window on a normal 24 line terminal.
  216. X.PP
  217. XThe interrupt character ends the program and clears the screen.
  218. X.SH "SEE ALSO"
  219. XUser Commands (1):  date
  220. X.SH AUTHOR
  221. XOriginally written by Jim Earenluindil Trethewey.
  222. X.PP
  223. XIt has been substantially modified by George M. Sipe (currently - 7/88,
  224. Xat rebel!george) to the point where Jim would no longer recognize it.
  225. SHAR_EOF
  226. fi
  227. if test -f 'clock.c'
  228. then
  229.     echo shar: "will not over-write existing file 'clock.c'"
  230. else
  231. sed 's/^X//' << \SHAR_EOF > 'clock.c'
  232. X/*   Copyright (c) 1988 by George M. Sipe.  All rights reserved.
  233. X
  234. XThis software may only be redistributed without fee and without any
  235. Xother form of monetary gain (including sold, rented, leased, or
  236. Xtraded), unless the express written permission of the copyright holder
  237. Xis obtained in advance.
  238. X
  239. XThis copyright notice must be reproduced in its entirety on all copies
  240. Xof this software.  Further, acknowledgment of the authorship of this
  241. Xsoftware must not be removed from its current or derived
  242. Xdocumentation.
  243. X
  244. XNo expressed or implied warranty is made for this software.  No party
  245. Xconnected with this software assumes any liability or responsibility
  246. Xfor its use, the correctness of its operation, or its fitness for any
  247. Xpurpose.
  248. X
  249. XAny distributor of copies of this software shall grant the recipient
  250. Xpermission for further redistribution as permitted by this notice.
  251. X
  252. XPermission is hereby granted to copy, reproduce, redistribute and
  253. Xotherwise use this software as long as the conditions above are
  254. Xstrictly adhered to.
  255. X
  256. X    NOTE:  This software was originally written by Jim Earenluindil
  257. X    Trethewey and modified by George M. Sipe (rebel!george) to the
  258. X    point where Jim would no longer recognize it.  No copyright
  259. X    notices were embodied in the original net distribution.
  260. X*/
  261. X
  262. X#include <stdio.h>
  263. X#include <curses.h>
  264. X#include <signal.h>
  265. X#include <sys/types.h>
  266. X
  267. X#ifndef    MSDOS
  268. X
  269. X#ifdef    BSD
  270. X
  271. X#include <strings.h>
  272. X#include <sys/ioctl.h>
  273. X#include <sys/time.h>
  274. Xextern    time_t time();
  275. X
  276. X#else    /* !BSD */
  277. X
  278. X#include <string.h>
  279. X#include <time.h>
  280. Xextern    long time();
  281. Xextern    unsigned int sleep();
  282. Xextern    void exit();
  283. X
  284. X#endif    /* !BSD */
  285. X
  286. Xextern    struct tm *localtime();
  287. Xextern    unsigned int alarm();
  288. Xextern  void pr_big();
  289. Xextern  void pr_colon();
  290. Xextern  void pr_space();
  291. Xstatic  int on_intr();
  292. Xstatic  void big_nums();
  293. Xstatic  void time_update();
  294. X
  295. X#else    /* MSDOS */
  296. X
  297. X#include <stdlib.h>
  298. X#undef    getch
  299. X#include <conio.h>
  300. X#include <string.h>
  301. X#include <time.h>
  302. X#include <local.h>
  303. Xextern  int main(int argc,char **argv);
  304. Xextern  void pr_big(int num,int col);
  305. Xextern  void pr_colon(int col);
  306. Xextern  void pr_space(void);
  307. Xstatic  int on_intr(void);
  308. Xstatic  void big_nums(int hrs,int mins);
  309. Xstatic  void time_update(void);
  310. X
  311. X#endif    /* MSDOS */
  312. X
  313. X#define    SYSLINE    0        /* line to put system name on */
  314. X#define    DIGITS    3        /* line to put digits on */
  315. X#define    DATETM    19        /* line to put full date and time on */
  316. X
  317. Xstatic int BASE;        /* base line for output */
  318. Xstatic struct tm *loc_time;    /* local time structure */
  319. Xstatic unsigned int refresh_rate;/* seconds between updates */
  320. X
  321. Xstatic char myname[40];        /* string to store system name in */
  322. X
  323. XWINDOW *scr;            /* screen where large numbers displayed */
  324. Xint curr_col;            /* current center of colon column */
  325. Xint NBASE;            /* numeric base line for output */
  326. X
  327. Xstatic int on_intr()
  328. X{
  329. X    refresh_rate = 0;
  330. X    alarm(0);
  331. X#ifdef    BSD
  332. X    kill(0, SIGALRM);
  333. X#endif
  334. X    return(0);
  335. X}
  336. X
  337. Xstatic void big_nums(hrs, mins)
  338. Xint hrs, mins;
  339. X{
  340. X    static int x_hr_h = -1, x_hr_l = -1;
  341. X    static int x_min_h = -1, x_min_l = -1, x_indent = -1;
  342. X    int hr_h, hr_l, min_h, min_l, indent;
  343. X
  344. X    hr_h = hrs / 10;
  345. X    hr_l = hrs % 10;
  346. X    min_h = mins / 10;
  347. X    min_l = mins % 10;
  348. X    indent = (hr_h == 0) ? 16 : 24;
  349. X    if (indent != x_indent) {
  350. X        pr_space();
  351. X        x_hr_h = x_hr_l = x_min_h = x_min_l = -1;
  352. X        pr_colon(indent + 15);
  353. X        x_indent = indent;
  354. X    }
  355. X    if ((hr_h != 0) && (hr_h != x_hr_h)) {
  356. X        pr_big(hr_h, 9);
  357. X        x_hr_h = hr_h;
  358. X    }
  359. X    if (hr_l != x_hr_l) {
  360. X        pr_big(hr_l, indent);
  361. X        x_hr_l = hr_l;
  362. X    }
  363. X    if (min_h != x_min_h) {
  364. X        pr_big(min_h, indent + 21);
  365. X        x_min_h = min_h;
  366. X    }
  367. X    if (min_l != x_min_l) {
  368. X        pr_big(min_l, indent + 36);
  369. X        x_min_l = min_l;
  370. X    }
  371. X}
  372. X
  373. Xstatic void time_update()
  374. X{
  375. X    time_t clock;
  376. X    char time_str[43];
  377. X    int t_hour, t_min, t_sec;
  378. X    int delta;
  379. X    static int colon = 15;
  380. X
  381. X    wmove(scr, BASE, 0);
  382. X    wclrtoeol(scr);
  383. X    wmove(scr, BASE, (COLS / 2 - strlen(myname) / 2));
  384. X    wprintw(scr, myname);
  385. X    wmove(scr, BASE + DATETM, 0);
  386. X    wclrtoeol(scr);
  387. X    (void) time(&clock);
  388. X    (void) strcpy(time_str, ctime(&clock));
  389. X    wmove(scr, BASE + DATETM, (COLS / 2 - strlen(time_str) / 2));
  390. X    wprintw(scr, time_str);
  391. X
  392. X    loc_time = localtime(&clock);
  393. X    t_hour = loc_time->tm_hour;
  394. X    if (t_hour > 12) t_hour = t_hour - 12;
  395. X    if (t_hour == 0) t_hour = 12;
  396. X    t_min = loc_time->tm_min;
  397. X    big_nums(t_hour, t_min);
  398. X    t_sec = loc_time->tm_sec;
  399. X    colon = (colon == 9) ? 4 : 9;
  400. X    wmove(scr, NBASE + colon, curr_col);
  401. X    wrefresh(scr);
  402. X    if (refresh_rate % 60 == 0)
  403. X        delta = refresh_rate
  404. X            - ((t_min % (refresh_rate / 60)) * 60)
  405. X            - (t_sec % 60);
  406. X    else
  407. X        delta = refresh_rate - (t_sec % refresh_rate);
  408. X    if (delta > 0) (void) sleep((unsigned) delta);
  409. X    else (void) sleep(refresh_rate);
  410. X#ifdef    MSDOS
  411. X    while (kbhit()) (void) getch();
  412. X#endif
  413. X}
  414. X
  415. Xint main(argc, argv)
  416. Xint argc;
  417. Xchar *argv[];
  418. X{
  419. X#ifdef BSD
  420. X    struct sgttyb tty_old, tty_new;
  421. X#endif
  422. X#ifdef    MSDOS
  423. X    int brk_old;
  424. X
  425. X    brk_old = setbreak(TRUE);
  426. X    if (argc == 1) refresh_rate = 1;
  427. X#else
  428. X    if (argc == 1) refresh_rate = 60;
  429. X#endif
  430. X    else if (argc == 2) refresh_rate = atoi(argv[1]);
  431. X    else {
  432. X        (void) printf("Usage: %s [refresh_rate]\n", argv[0]);
  433. X        exit(1);
  434. X    }
  435. X    if (refresh_rate < 1) refresh_rate = 1;
  436. X#ifdef BSD
  437. X    if (ioctl(1, TIOCGETP, &tty_old) < 0) perror("ioctl TIOCGETP");
  438. X    tty_new = tty_old;
  439. X    tty_new.sg_flags |= XTABS;
  440. X    if (ioctl(1, TIOCSETP, &tty_new) < 0) perror("ioctl TIOCSETP");
  441. X#endif
  442. X    initscr();
  443. X    BASE = LINES - 21 + SYSLINE;
  444. X    NBASE = BASE + DIGITS;
  445. X    (void) gethostname(myname,sizeof(myname));
  446. X    noecho();
  447. X    nonl();
  448. X    scr = newwin(LINES, COLS, 0, 0);
  449. X    scrollok(scr, FALSE);
  450. X    leaveok(scr, FALSE);
  451. X    wclear(scr);
  452. X    (void) signal(SIGINT, on_intr);
  453. X    for ( ; refresh_rate; ) time_update();
  454. X    wclear(scr);
  455. X    wmove(scr, LINES - 1, 0);
  456. X    wclrtoeol(scr);
  457. X    wrefresh(scr);
  458. X    endwin();
  459. X#ifdef BSD
  460. X    if (ioctl(1, TIOCSETP, &tty_old) < 0) perror("ioctl TIOCSETP");
  461. X#endif
  462. X#ifdef    MSDOS
  463. X    (void) setbreak(brk_old);
  464. X#endif
  465. X    return(0);
  466. X}
  467. SHAR_EOF
  468. fi
  469. if test -f 'digits.c'
  470. then
  471.     echo shar: "will not over-write existing file 'digits.c'"
  472. else
  473. sed 's/^X//' << \SHAR_EOF > 'digits.c'
  474. X/*   Copyright (c) 1988 by George M. Sipe.  All rights reserved.
  475. X
  476. XThis software may only be redistributed without fee and without any
  477. Xother form of monetary gain (including sold, rented, leased, or
  478. Xtraded), unless the express written permission of the copyright holder
  479. Xis obtained in advance.
  480. X
  481. XThis copyright notice must be reproduced in its entirety on all copies
  482. Xof this software.  Further, acknowledgment of the authorship of this
  483. Xsoftware must not be removed from its current or derived
  484. Xdocumentation.
  485. X
  486. XNo expressed or implied warranty is made for this software.  No party
  487. Xconnected with this software assumes any liability or responsibility
  488. Xfor its use, the correctness of its operation, or its fitness for any
  489. Xpurpose.
  490. X
  491. XAny distributor of copies of this software shall grant the recipient
  492. Xpermission for further redistribution as permitted by this notice.
  493. X
  494. XPermission is hereby granted to copy, reproduce, redistribute and
  495. Xotherwise use this software as long as the conditions above are
  496. Xstrictly adhered to.
  497. X
  498. X    NOTE:  This software was originally written by Jim Earenluindil
  499. X    Trethewey and modified by George M. Sipe (rebel!george) to the
  500. X    point where Jim would no longer recognize it.  No copyright
  501. X    notices were embodied in the original net distribution.
  502. X*/
  503. X
  504. X#include <curses.h>
  505. X
  506. X#ifndef    MSDOS
  507. Xextern  void pr_colon();
  508. Xextern  void pr_space();
  509. Xextern  void pr_big();
  510. X#else
  511. Xextern  void pr_colon(int col);
  512. Xextern  void pr_space(void);
  513. Xextern  void pr_big(int num,int col);
  514. X#endif
  515. X
  516. Xextern WINDOW *scr;        /* screen where large numbers displayed */
  517. Xextern int curr_col;        /* current center of colon column */
  518. Xextern int NBASE;        /* numeric base line for output */
  519. X
  520. Xvoid pr_colon(col)
  521. Xint col;
  522. X{
  523. X    curr_col = col + 1;
  524. X    wmove(scr, NBASE     , col); wprintw(scr, "   ");
  525. X    wmove(scr, NBASE +  1, col); wprintw(scr, "   ");
  526. X    wmove(scr, NBASE +  2, col); wprintw(scr, "   ");
  527. X    wmove(scr, NBASE +  3, col); wprintw(scr, " # ");
  528. X    wmove(scr, NBASE +  4, col); wprintw(scr, "###");
  529. X    wmove(scr, NBASE +  5, col); wprintw(scr, " # ");
  530. X    wmove(scr, NBASE +  6, col); wprintw(scr, "   ");
  531. X    wmove(scr, NBASE +  7, col); wprintw(scr, "   ");
  532. X    wmove(scr, NBASE +  8, col); wprintw(scr, " # ");
  533. X    wmove(scr, NBASE +  9, col); wprintw(scr, "###");
  534. X    wmove(scr, NBASE + 10, col); wprintw(scr, " # ");
  535. X    wmove(scr, NBASE + 11, col); wprintw(scr, "   ");
  536. X    wmove(scr, NBASE + 12, col); wprintw(scr, "   ");
  537. X    wmove(scr, NBASE + 13, col); wprintw(scr, "   ");
  538. X}
  539. X
  540. Xvoid pr_space()
  541. X{
  542. X    int i;
  543. X    for(i = NBASE; i < NBASE + 14; i++) {
  544. X        wmove(scr, i,  9);
  545. X        wprintw(scr, "                                   ");
  546. X        wmove(scr, i, 42);
  547. X        wprintw(scr, "                                   ");
  548. X    }
  549. X}
  550. X
  551. Xvoid pr_big(num, col)
  552. Xint num;
  553. Xint col;
  554. X{
  555. X    if(num == 0) {
  556. X        wmove(scr, NBASE     , col); wprintw(scr, "   ######   ");
  557. X        wmove(scr, NBASE +  1, col); wprintw(scr, " ########## ");
  558. X        wmove(scr, NBASE +  2, col); wprintw(scr, "####    ####");
  559. X        wmove(scr, NBASE +  3, col); wprintw(scr, "###      ###");
  560. X        wmove(scr, NBASE +  4, col); wprintw(scr, "###      ###");
  561. X        wmove(scr, NBASE +  5, col); wprintw(scr, "###      ###");
  562. X        wmove(scr, NBASE +  6, col); wprintw(scr, "###      ###");
  563. X        wmove(scr, NBASE +  7, col); wprintw(scr, "###      ###");
  564. X        wmove(scr, NBASE +  8, col); wprintw(scr, "###      ###");
  565. X        wmove(scr, NBASE +  9, col); wprintw(scr, "###      ###");
  566. X        wmove(scr, NBASE + 10, col); wprintw(scr, "###      ###");
  567. X        wmove(scr, NBASE + 11, col); wprintw(scr, "####    ####");
  568. X        wmove(scr, NBASE + 12, col); wprintw(scr, " ########## ");
  569. X        wmove(scr, NBASE + 13, col); wprintw(scr, "   ######   ");
  570. X    } else if(num == 1) {
  571. X        wmove(scr, NBASE     , col); wprintw(scr, "      ##    ");
  572. X        wmove(scr, NBASE +  1, col); wprintw(scr, "     ###    ");
  573. X        wmove(scr, NBASE +  2, col); wprintw(scr, "    ####    ");
  574. X        wmove(scr, NBASE +  3, col); wprintw(scr, "   #####    ");
  575. X        wmove(scr, NBASE +  4, col); wprintw(scr, "     ###    ");
  576. X        wmove(scr, NBASE +  5, col); wprintw(scr, "     ###    ");
  577. X        wmove(scr, NBASE +  6, col); wprintw(scr, "     ###    ");
  578. X        wmove(scr, NBASE +  7, col); wprintw(scr, "     ###    ");
  579. X        wmove(scr, NBASE +  8, col); wprintw(scr, "     ###    ");
  580. X        wmove(scr, NBASE +  9, col); wprintw(scr, "     ###    ");
  581. X        wmove(scr, NBASE + 10, col); wprintw(scr, "     ###    ");
  582. X        wmove(scr, NBASE + 11, col); wprintw(scr, "     ###    ");
  583. X        wmove(scr, NBASE + 12, col); wprintw(scr, "   #######  ");
  584. X        wmove(scr, NBASE + 13, col); wprintw(scr, "   #######  ");
  585. X    } else if(num == 2) {
  586. X        wmove(scr, NBASE     , col); wprintw(scr, "  ########  ");
  587. X        wmove(scr, NBASE +  1, col); wprintw(scr, " ########## ");
  588. X        wmove(scr, NBASE +  2, col); wprintw(scr, "###     ####");
  589. X        wmove(scr, NBASE +  3, col); wprintw(scr, "###      ###");
  590. X        wmove(scr, NBASE +  4, col); wprintw(scr, "         ###");
  591. X        wmove(scr, NBASE +  5, col); wprintw(scr, "         ###");
  592. X        wmove(scr, NBASE +  6, col); wprintw(scr, "         ###");
  593. X        wmove(scr, NBASE +  7, col); wprintw(scr, "        ### ");
  594. X        wmove(scr, NBASE +  8, col); wprintw(scr, "       ###  ");
  595. X        wmove(scr, NBASE +  9, col); wprintw(scr, "     ####   ");
  596. X        wmove(scr, NBASE + 10, col); wprintw(scr, "   ####     ");
  597. X        wmove(scr, NBASE + 11, col); wprintw(scr, " ####       ");
  598. X        wmove(scr, NBASE + 12, col); wprintw(scr, "############");
  599. X        wmove(scr, NBASE + 13, col); wprintw(scr, "############");
  600. X    } else if(num == 3) {
  601. X        wmove(scr, NBASE     , col); wprintw(scr, "  ########  ");
  602. X        wmove(scr, NBASE +  1, col); wprintw(scr, " ########## ");
  603. X        wmove(scr, NBASE +  2, col); wprintw(scr, "###     ####");
  604. X        wmove(scr, NBASE +  3, col); wprintw(scr, "###      ###");
  605. X        wmove(scr, NBASE +  4, col); wprintw(scr, "         ###");
  606. X        wmove(scr, NBASE +  5, col); wprintw(scr, "         ###");
  607. X        wmove(scr, NBASE +  6, col); wprintw(scr, "    ####### ");
  608. X        wmove(scr, NBASE +  7, col); wprintw(scr, "    ####### ");
  609. X        wmove(scr, NBASE +  8, col); wprintw(scr, "         ###");
  610. X        wmove(scr, NBASE +  9, col); wprintw(scr, "         ###");
  611. X        wmove(scr, NBASE + 10, col); wprintw(scr, "###      ###");
  612. X        wmove(scr, NBASE + 11, col); wprintw(scr, "###     ####");
  613. X        wmove(scr, NBASE + 12, col); wprintw(scr, " ########## ");
  614. X        wmove(scr, NBASE + 13, col); wprintw(scr, "  ########  ");
  615. X    } else if(num == 4) {
  616. X        wmove(scr, NBASE     , col); wprintw(scr, "       ###  ");
  617. X        wmove(scr, NBASE +  1, col); wprintw(scr, "      ####  ");
  618. X        wmove(scr, NBASE +  2, col); wprintw(scr, "     #####  ");
  619. X        wmove(scr, NBASE +  3, col); wprintw(scr, "    ######  ");
  620. X        wmove(scr, NBASE +  4, col); wprintw(scr, "   ### ###  ");
  621. X        wmove(scr, NBASE +  5, col); wprintw(scr, "  ###  ###  ");
  622. X        wmove(scr, NBASE +  6, col); wprintw(scr, " ###   ###  ");
  623. X        wmove(scr, NBASE +  7, col); wprintw(scr, "############");
  624. X        wmove(scr, NBASE +  8, col); wprintw(scr, "############");
  625. X        wmove(scr, NBASE +  9, col); wprintw(scr, "       ###  ");
  626. X        wmove(scr, NBASE + 10, col); wprintw(scr, "       ###  ");
  627. X        wmove(scr, NBASE + 11, col); wprintw(scr, "       ###  ");
  628. X        wmove(scr, NBASE + 12, col); wprintw(scr, "       ###  ");
  629. X        wmove(scr, NBASE + 13, col); wprintw(scr, "       ###  ");
  630. X    } else if(num == 5) {
  631. X        wmove(scr, NBASE     , col); wprintw(scr, "############");
  632. X        wmove(scr, NBASE +  1, col); wprintw(scr, "############");
  633. X        wmove(scr, NBASE +  2, col); wprintw(scr, "###         ");
  634. X        wmove(scr, NBASE +  3, col); wprintw(scr, "###         ");
  635. X        wmove(scr, NBASE +  4, col); wprintw(scr, "### ######  ");
  636. X        wmove(scr, NBASE +  5, col); wprintw(scr, "########### ");
  637. X        wmove(scr, NBASE +  6, col); wprintw(scr, "###     ####");
  638. X        wmove(scr, NBASE +  7, col); wprintw(scr, "         ###");
  639. X        wmove(scr, NBASE +  8, col); wprintw(scr, "         ###");
  640. X        wmove(scr, NBASE +  9, col); wprintw(scr, "         ###");
  641. X        wmove(scr, NBASE + 10, col); wprintw(scr, "###      ###");
  642. X        wmove(scr, NBASE + 11, col); wprintw(scr, "###     ####");
  643. X        wmove(scr, NBASE + 12, col); wprintw(scr, " ########## ");
  644. X        wmove(scr, NBASE + 13, col); wprintw(scr, "  ########  ");
  645. X    } else if(num == 6) {
  646. X        wmove(scr, NBASE     , col); wprintw(scr, "       ###  ");
  647. X        wmove(scr, NBASE +  1, col); wprintw(scr, "      ###   ");
  648. X        wmove(scr, NBASE +  2, col); wprintw(scr, "     ###    ");
  649. X        wmove(scr, NBASE +  3, col); wprintw(scr, "    ###     ");
  650. X        wmove(scr, NBASE +  4, col); wprintw(scr, "   ###      ");
  651. X        wmove(scr, NBASE +  5, col); wprintw(scr, "  ###       ");
  652. X        wmove(scr, NBASE +  6, col); wprintw(scr, " #########  ");
  653. X        wmove(scr, NBASE +  7, col); wprintw(scr, "########### ");
  654. X        wmove(scr, NBASE +  8, col); wprintw(scr, "###      ###");
  655. X        wmove(scr, NBASE +  9, col); wprintw(scr, "###      ###");
  656. X        wmove(scr, NBASE + 10, col); wprintw(scr, "###      ###");
  657. X        wmove(scr, NBASE + 11, col); wprintw(scr, "###      ###");
  658. X        wmove(scr, NBASE + 12, col); wprintw(scr, " ########## ");
  659. X        wmove(scr, NBASE + 13, col); wprintw(scr, "   ######   ");
  660. X    } else if(num == 7) {
  661. X        wmove(scr, NBASE     , col); wprintw(scr, "############");
  662. X        wmove(scr, NBASE +  1, col); wprintw(scr, "############");
  663. X        wmove(scr, NBASE +  2, col); wprintw(scr, "###      ###");
  664. X        wmove(scr, NBASE +  3, col); wprintw(scr, "         ###");
  665. X        wmove(scr, NBASE +  4, col); wprintw(scr, "         ###");
  666. X        wmove(scr, NBASE +  5, col); wprintw(scr, "        ### ");
  667. X        wmove(scr, NBASE +  6, col); wprintw(scr, "       ###  ");
  668. X        wmove(scr, NBASE +  7, col); wprintw(scr, "      ###   ");
  669. X        wmove(scr, NBASE +  8, col); wprintw(scr, "     ###    ");
  670. X        wmove(scr, NBASE +  9, col); wprintw(scr, "    ###     ");
  671. X        wmove(scr, NBASE + 10, col); wprintw(scr, "   ###      ");
  672. X        wmove(scr, NBASE + 11, col); wprintw(scr, "  ###       ");
  673. X        wmove(scr, NBASE + 12, col); wprintw(scr, " ###        ");
  674. X        wmove(scr, NBASE + 13, col); wprintw(scr, "###         ");
  675. X    } else if(num == 8) {
  676. X        wmove(scr, NBASE     , col); wprintw(scr, "   ######   ");
  677. X        wmove(scr, NBASE +  1, col); wprintw(scr, " ########## ");
  678. X        wmove(scr, NBASE +  2, col); wprintw(scr, "###      ###");
  679. X        wmove(scr, NBASE +  3, col); wprintw(scr, "###      ###");
  680. X        wmove(scr, NBASE +  4, col); wprintw(scr, "###      ###");
  681. X        wmove(scr, NBASE +  5, col); wprintw(scr, "###      ###");
  682. X        wmove(scr, NBASE +  6, col); wprintw(scr, " ########## ");
  683. X        wmove(scr, NBASE +  7, col); wprintw(scr, " ########## ");
  684. X        wmove(scr, NBASE +  8, col); wprintw(scr, "###      ###");
  685. X        wmove(scr, NBASE +  9, col); wprintw(scr, "###      ###");
  686. X        wmove(scr, NBASE + 10, col); wprintw(scr, "###      ###");
  687. X        wmove(scr, NBASE + 11, col); wprintw(scr, "###      ###");
  688. X        wmove(scr, NBASE + 12, col); wprintw(scr, " ########## ");
  689. X        wmove(scr, NBASE + 13, col); wprintw(scr, "   ######   ");
  690. X    } else if(num == 9) {
  691. X        wmove(scr, NBASE     , col); wprintw(scr, "   ######   ");
  692. X        wmove(scr, NBASE +  1, col); wprintw(scr, " ########## ");
  693. X        wmove(scr, NBASE +  2, col); wprintw(scr, "###      ###");
  694. X        wmove(scr, NBASE +  3, col); wprintw(scr, "###      ###");
  695. X        wmove(scr, NBASE +  4, col); wprintw(scr, "###      ###");
  696. X        wmove(scr, NBASE +  5, col); wprintw(scr, "###      ###");
  697. X        wmove(scr, NBASE +  6, col); wprintw(scr, " ###########");
  698. X        wmove(scr, NBASE +  7, col); wprintw(scr, "  ######### ");
  699. X        wmove(scr, NBASE +  8, col); wprintw(scr, "       ###  ");
  700. X        wmove(scr, NBASE +  9, col); wprintw(scr, "      ###   ");
  701. X        wmove(scr, NBASE + 10, col); wprintw(scr, "     ###    ");
  702. X        wmove(scr, NBASE + 11, col); wprintw(scr, "    ###     ");
  703. X        wmove(scr, NBASE + 12, col); wprintw(scr, "   ###      ");
  704. X        wmove(scr, NBASE + 13, col); wprintw(scr, "  ###       ");
  705. X    }
  706. X}
  707. SHAR_EOF
  708. fi
  709. exit 0
  710. #    End of shell archive
  711. -- 
  712. George M. Sipe,        Phone: (404) 662-1533
  713. Tolerant Systems, 6961 Peachtree Industrial, Norcross, GA  30071
  714. UUCP: ...!{decvax,hplabs,linus,rutgers,seismo}!gatech!rebel!george
  715.